
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpDicmngDictab.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpDicmngDictabForm"
 */
public class CcpDicmngDictabForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _dicCode = null;
   private java.lang.String _dicName = null;
   private java.lang.String _dicType = null;

   /**
    * Standard constructor.
    */
   public CcpDicmngDictabForm() {
   }

   /**
    * Returns the dicCode
    *
    * @return the dicCode
    */
   public java.lang.String getDicCode() {
      return _dicCode;
   }

   /**
    * Sets the dicCode
    *
    * @param dicCode the new dicCode value
    */
   public void setDicCode(java.lang.String dicCode) {
      _dicCode = dicCode;
   }
   /**
    * Returns the dicName
    *
    * @return the dicName
    */
   public java.lang.String getDicName() {
      return _dicName;
   }

   /**
    * Sets the dicName
    *
    * @param dicName the new dicName value
    */
   public void setDicName(java.lang.String dicName) {
      _dicName = dicName;
   }
   /**
    * Returns the dicType
    *
    * @return the dicType
    */
   public java.lang.String getDicType() {
      return _dicType;
   }

   /**
    * Sets the dicType
    *
    * @param dicType the new dicType value
    */
   public void setDicType(java.lang.String dicType) {
      _dicType = dicType;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getDicCode() == null) {
         errors.add("dicCode", new ActionError("error.dicCode.required"));
      }
      // TODO test format/data
      return errors;
   }
}
